package com.syedu.day08.homework;

/**
 * @Description 圆形子类
 * @createTime 2022/3/17 16:35
 * @author Administrator
 */
public class Circle extends Shape {
    private double radius;//半径

    public Circle() {
    }

    public Circle(int radius) {
        this.radius = radius;
    }

    public double getRadius() {
        return radius;
    }

    public void setRadius(double radius) {
        this.radius = radius;
    }

    @Override
    public double calcLength() {
        return 2 * Math.PI * radius;
    }

    @Override
    public double calcArea() {
        return Math.PI * radius * radius;
    }
}
